using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TablePayMethod
	{
		public const string Table = "PayMethod";
		public const string PayMethodID = "PayMethodID";
		public const string PayMethodName = "PayMethodName";
		public const string PayMethodCode = "PayMethodCode";
		public const string PayCode = "PayCode";
		public const string PayUrl = "PayUrl";
		public const string IsEnable = "IsEnable";
		public const string Description = "Description";
	}
	
	[Serializable]
	public class BasePayMethod
		: IDbSessionEntity, IJsonClass
	{
		int m_PayMethodID;
		/// <summary>
        /// 
        /// </summary>
        public int PayMethodID
        {
            get { return m_PayMethodID; }
            set { m_PayMethodID = value; }
        }
		
		string m_PayMethodName;
		/// <summary>
        /// 
        /// </summary>
        public string PayMethodName
        {
            get { return m_PayMethodName; }
            set { m_PayMethodName = value; }
        }
		
		string m_PayMethodCode;
		/// <summary>
        /// 
        /// </summary>
        public string PayMethodCode
        {
            get { return m_PayMethodCode; }
            set { m_PayMethodCode = value; }
        }
		
		string m_PayCode;
		/// <summary>
        /// 
        /// </summary>
        public string PayCode
        {
            get { return m_PayCode; }
            set { m_PayCode = value; }
        }
		
		string m_PayUrl;
		/// <summary>
        /// 
        /// </summary>
        public string PayUrl
        {
            get { return m_PayUrl; }
            set { m_PayUrl = value; }
        }
		
		int m_IsEnable;
		/// <summary>
        /// 
        /// </summary>
        public int IsEnable
        {
            get { return m_IsEnable; }
            set { m_IsEnable = value; }
        }
		
		string m_Description;
		/// <summary>
        /// 
        /// </summary>
        public string Description
        {
            get { return m_Description; }
            set { m_Description = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_PayMethodID = reader[TablePayMethod.PayMethodID];
            m_PayMethodName = reader[TablePayMethod.PayMethodName];
            m_PayMethodCode = reader[TablePayMethod.PayMethodCode];
            m_PayCode = reader[TablePayMethod.PayCode];
            m_PayUrl = reader[TablePayMethod.PayUrl];
            m_IsEnable = reader[TablePayMethod.IsEnable];
            m_Description = reader[TablePayMethod.Description];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TablePayMethod.PayMethodID, PrimaryKeyType.Identity, PayMethodID);
			writer[TablePayMethod.PayMethodName] = PayMethodName;
			writer[TablePayMethod.PayMethodCode] = PayMethodCode;
			writer[TablePayMethod.PayCode] = PayCode;
			writer[TablePayMethod.PayUrl] = PayUrl;
			writer[TablePayMethod.IsEnable] = IsEnable;
			writer[TablePayMethod.Description] = Description;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_PayMethodID = idd;
        }
		
		public string TableName
        {
            get { return TablePayMethod.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_PayMethodID = hashToRead["PayMethodID"];
			 
             m_PayMethodName = hashToRead["PayMethodName"];
			 
             m_PayMethodCode = hashToRead["PayMethodCode"];
			 
             m_PayCode = hashToRead["PayCode"];
			 
             m_PayUrl = hashToRead["PayUrl"];
			 
             m_IsEnable = hashToRead["IsEnable"];
			 
             m_Description = hashToRead["Description"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["PayMethodID"] = PayMethodID;
			 
            hashToFill["PayMethodName"] = PayMethodName;
			 
            hashToFill["PayMethodCode"] = PayMethodCode;
			 
            hashToFill["PayCode"] = PayCode;
			 
            hashToFill["PayUrl"] = PayUrl;
			 
            hashToFill["IsEnable"] = IsEnable;
			 
            hashToFill["Description"] = Description;
			 
        }

        #endregion
		
	}
}
